package com.education.springbootdemo.vo;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class User {
    private Long id;

    @NotNull
    private String username;

    @NotNull
    @Pattern(regexp = "^[A-Za-z0-9]+[A-Za-z0-9._%+-]*@[A-Za-z0-9]+[A-Za-z0-9.-]*\\.[A-Za-z]{2,}$")
    private String email;

    private String hobby;

    //使用正则表达式校验身份证号
    private String idNumber;

    //电话
    @NotNull
    @Pattern(regexp = "^1[3-9]\\d{9}$")
    private String phone;

    private Integer gender;

    private  String password;
}
